package com.toobigtofail
{
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.Graphic;
	import net.flashpunk.Mask;
	import net.flashpunk.graphics.Graphiclist;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.masks.Pixelmask;
	
	public class Ouroboros extends Entity
	{
		[Embed(source="/assets/gfx/ouroboros.png")] private static const OUROBOROS_PNG:Class;
		//[Embed(source="/assets/gfx/ouroboros-mask.png")] private static const OUROBOROS_MASK_PNG:Class;
		private var _ouroborosImg:Image = new Image(OUROBOROS_PNG);
		public var isSlow:Boolean = false;
		public function Ouroboros()
		{
			this.x = 0;
			this.y = 0;
			this.setHitbox(FP.width, FP.height);
			
			_ouroborosImg.originX = _ouroborosImg.width/2;
			_ouroborosImg.originY = _ouroborosImg.height/2;
			_ouroborosImg.x = -FP.width/2 - 170;
			_ouroborosImg.y = -(_ouroborosImg.height/2) - FP.height + 700;
			
			/*
			_ouroborosImg.originX = _ouroborosImg.width/2;
			_ouroborosImg.originY = _ouroborosImg.height/2;
			this.x = -_ouroborosImg.width/2 + FP.width/2 + 11;
			this.y = -_ouroborosImg.height/2 - 85;
			this.setHitbox(this._ouroborosImg.width, this._ouroborosImg.height);
			*/
			//mask = new Pixelmask(OUROBOROS_MASK_PNG);
			graphic = _ouroborosImg;
		}
		
		override public function update():void
		{
			_ouroborosImg.angle -= FP.elapsed* (isSlow ? 13 : 45);
			
			super.update();
		}
	}
}